<script type="text/javascript">
var _d = DialogManager.get('config_dialog');
_d.setWidth(540);
_d.setPosition('center');
$(function(){
	$("select[name='img_recom_id']").change(function(){
		switchRecommend(this.value, 'img_cate_id');
	});
	
	switchRecommend($("select[name='img_recom_id']").val(), 'img_cate_id');
});

function switchRecommend(recomId, selectName)
{
    if (recomId >= 0)
    {
        $("select[name='" + selectName + "']").hide();
    }
    else
    {
        $("select[name='" + selectName + "']").show();
    }
}

function loadImage(obj){
    getTempPath(obj,function(res){
        $(obj).parent().find('img').attr('src',res);
    });
}
</script>
<div class="field_item webkit-box file-box box-align-center">
    <label>左侧图片</label>
    <p class="relative">
        <input class="file absolute pointer" type="file" name="ad_image_file" onchange="loadImage(this)" />
        <input type="hidden" name="ad_image_url" value="{$options.ad_image_url}" />
        <img src="{if $options.ad_image_url}{$options.ad_image_url|url_format}{else}{res file='images/upload.png'}{/if}"/>
    </p>
    <font class="ml10 fs12" color="gray">点击图片上传,图片大小：484*177px</font>
</div>
<div class="field_item webkit-box">
    <label>链接地址</label>
    <p><input type="text" name="ad_link_url" value="{$options.ad_link_url}" /></p>
</div>
<div class="field_item webkit-box">
    <label>品牌标签</label>
    <p><input type="text" name="btag" value="{$options.btag}" /></p>
</div>



